
#pragma once

#include "type.h"

typedef long long int64_t;

#define GM                     GameManager::getInstance()

#define X_SCALE(s)             (GM->xscale * (s))
#define Y_SCALE(s)             (GM->yscale * (s))
#define SCALE_PT(s)            Point(X_SCALE(s.x), Y_SCALE(s.y))
#define XY_SCALE(x,y)          Point(GM->xscale * (x), GM->yscale * (y))
#define MIN_SCALE(x, y)        Point(GM->minscale * (x), GM->minscale * (y))

class Unit;
class GamePlayScene;

class GameManager: public Object {
public:
    static const int BASE_WIDTH = 960;
    static const int BASE_HEIGHT = 640;
	static const int DESIGN_DPI = 132;
	static const int DESIGN_WIDTH_INCH = 5;

	static GameManager * getInstance();
	~GameManager();

	Point getParentCenterPosition(Node* parent);
	Point getLogicPosition(const Point& pt);

	void setGamePlayScene(GamePlayScene* scene);
	GamePlayScene* getGamePlayScene();

public:
	Size screenSize;
	float xscale;
	float yscale;
	float minscale;
	float dpi;

private:
	GameManager();
	static GameManager *_instance;

	GamePlayScene* _playScene;
};
